local fanxiang = fk.CreateSkill {

  name = "joy_mou__fanxiang",

  tags = { Skill.Limited, },

}



fanxiang:addEffect("active", {
  name = "joy_mou__fanxiang",
  anim_type = "offensive",
  card_num = 0,
  target_num = 0,
  prompt = "返乡：获得其他有“姻”的角色所有装备区的牌，然后移除全场“姻”与技能〖结姻〗。",
  frequency = Skill.Limited,
  can_use = function(self, player)
    return player:usedSkillTimes(fanxiang.name, Player.HistoryGame) == 0
  end,
  card_filter = Util.FalseFunc,
  on_use = function(self, room, effect)
    local player = effect.from
    local cards = {}
    for _, p in ipairs(room:getOtherPlayers(player)) do
      if p:getMark("@@joy_mou_yan") > 0 and #p:getCardIds("e") > 0 then
        table.insertTableIfNeed(cards,p:getCardIds("e"))
      end
    end
    if #cards > 0 then
      local dummy = Fk:cloneCard'slash'
      dummy:addSubcards(cards)
      room:obtainCard(player, dummy, false, fk.ReasonPrey)
    end
    for _, p in ipairs(room.alive_players) do
      room:setPlayerMark(p,"@@joy_mou_yan",0)
      room:handleAddLoseSkills(p,"-joy_mou__jieyin")
    end
    if player.dead then return end
    room:handleAddLoseSkills(player,"joy__wujian")
    room:changeKingdom(player,"wu", true)
  end,
})

return fanxiang